use crate::noita::types::{StdString, StdVec, Vec2};
use std::ffi::c_void;
#[allow(dead_code)]
#[repr(C)]
#[derive(Debug)]
pub struct PlatformVTable {
    unk0: *const usize,
    unk1: *const usize,
    unk2: *const usize,
    unk3: *const usize,
    unk4: *const usize,
    unk5: *const usize,
    unk6: *const usize,
    unk7: *const usize,
}
#[derive(Debug)]
#[repr(C)]
pub struct Platform {
    pub vftable: &'static PlatformVTable,
    pub application: *const c_void,
    pub app_config: &'static WizardAppConfig,
    pub internal_width: f32,
    pub internal_height: f32,
    pub input_disabled: bool,
    padding1: [u8; 3],
    pub graphics: *const c_void,
    pub fixed_time_step: bool,
    padding2: [u8; 3],
    pub frame_count: isize,
    pub frame_rate: isize,
    pub last_frame_execution_time: f64,
    pub average_frame_execution_time: f64,
    pub one_frame_should_last: f64,
    pub time_elapsed_tracker: f64,
    pub width: isize,
    pub height: isize,
    pub event_recorder: *const c_void,
    pub mouse: *const c_void,
    pub keyboard: *const c_void,
    pub touch: *const c_void,
    pub joysticks: StdVec<*const c_void>,
    pub sound_player: *const c_void,
    pub file_system: *const c_void,
    pub running: bool,
    padding3: [u8; 3],
    pub mouse_pos: Vec2,
    pub sleeping_mode: isize,
    pub print_framerate: bool,
    padding4: [u8; 3],
    pub working_dir: StdString,
    pub random_i: isize,
    pub random_seed: isize,
    pub joysticks_enabled: bool,
    padding5: [u8; 3],
}
#[allow(dead_code)]
#[repr(C)]
#[derive(Debug)]
pub struct AppConfigVTable {
    unk0: *const usize,
    unk1: *const usize,
    unk2: *const usize,
    unk3: *const usize,
    unk4: *const usize,
    unk5: *const usize,
    unk6: *const usize,
    unk7: *const usize,
}
#[derive(Debug)]
#[repr(C)]
pub struct AppConfig {
    pub vftable: &'static AppConfigVTable,
    pub internal_size_w: u32,
    pub internal_size_h: u32,
    pub framerate: u32,
    pub iphone_is_landscape: bool,
    pub sounds: bool,
    pub event_recorder_flush_every_frame: bool,
    pub record_events: bool,
    pub do_a_playback: bool,
    padding1: [u8; 3],
    pub playback_file: StdString,
    pub report_fps: bool,
    pub joysticks_enabled: bool,
    padding2: [u8; 2],
    pub joystick_rumble_intensity: f32,
    pub graphics_settings: GraphicsSettings,
    pub set_random_seed_cb: *const c_void,
}
#[derive(Debug)]
#[repr(C)]
pub struct WizardAppConfig {
    pub parent: AppConfig,
    pub has_been_started_before: bool,
    pub audio_fmod: bool,
    padding1: [u8; 2],
    pub audio_music_volume: f32,
    pub audio_effects_volume: f32,
    pub rendering_low_quality: bool,
    pub rendering_low_resolution: bool,
    pub rendering_pixel_art_antialiasing: bool,
    padding2: u8,
    pub rendering_brightness_delta: f32,
    pub rendering_contrast_delta: f32,
    pub rendering_gamma_delta: f32,
    pub rendering_teleport_flash_brightness: f32,
    pub rendering_cosmetic_particle_count_coeff: f32,
    pub backbuffer_width: isize,
    pub backbuffer_height: isize,
    pub application_rendered_cursor: bool,
    padding3: [u8; 3],
    pub screenshake_intensity: f32,
    pub ui_inventory_icons_always_clickable: bool,
    pub ui_allow_shooting_while_inventory_open: bool,
    pub ui_report_damage: bool,
    pub ui_show_world_hover_info_next_to_mouse: bool,
    pub replay_recorder_enabled: bool,
    padding4: [u8; 3],
    pub replay_recorder_max_budget_mb: u32,
    pub replay_recorder_max_resolution_x: u32,
    pub replay_recorder_max_resolution_y: u32,
    pub language: StdString,
    pub check_for_updates: bool,
    padding5: [u8; 3],
    pub last_started_game_version_hash: StdString,
    pub config_format_version: u32,
    pub is_default_config: bool,
    padding6: [u8; 3],
    pub keyboard_controls: ControlsConfig,
    pub gamepad_controls: ControlsConfig,
    pub gamepad_mode: isize,
    pub rendering_filmgrain: bool,
    pub online_features: bool,
    padding7: [u8; 2],
    pub steam_cloud_size_warning_limit_mb: f32,
    pub _unknown_bool: bool,
    pub mouse_capture_inside_window: bool,
    pub ui_snappy_hover_boxes: bool,
    pub application_pause_when_unfocused: bool,
    pub gamepad_analog_flying: bool,
    padding8: [u8; 3],
    pub mods_active: StdString,
    pub mods_active_privileged: StdString,
    pub mods_sandbox_enabled: bool,
    pub mods_sandbox_warning_done: bool,
    pub mods_disclaimer_accepted: bool,
    pub streaming_integration_autoconnect: bool,
    pub streaming_integration_channel_name: StdString,
    pub streaming_integration_events_per_vote: u32,
    pub _unknown_streaming_number: f32,
    pub streaming_integration_time_seconds_voting: f32,
    pub streaming_integration_time_seconds_between_votings: f32,
    pub streaming_integration_play_new_vote_sound: bool,
    pub streaming_integration_viewernames_ghosts: bool,
    pub streaming_integration_hide_votes_during_voting: bool,
    pub streaming_integration_ui_pos_left: bool,
    pub single_threaded_loading: bool,
    padding9: [u8; 3],
    pub _unknown_string: StdString,
    pub debug_dont_load_other_config: bool,
    padding10: [u8; 3],
}
#[derive(Debug)]
#[repr(C)]
pub struct ControlsConfigKey {
    pub primary: isize,
    pub secondary: isize,
    pub primary_name: StdString,
    pub secondary_name: StdString,
}
#[derive(Debug)]
#[repr(C)]
pub struct ControlsConfig {
    pub key_up: ControlsConfigKey,
    pub key_down: ControlsConfigKey,
    pub key_left: ControlsConfigKey,
    pub key_right: ControlsConfigKey,
    pub key_use_wand: ControlsConfigKey,
    pub key_spray_flask: ControlsConfigKey,
    pub key_throw: ControlsConfigKey,
    pub key_kick: ControlsConfigKey,
    pub key_inventory: ControlsConfigKey,
    pub key_interact: ControlsConfigKey,
    pub key_drop_item: ControlsConfigKey,
    pub key_drink_potion: ControlsConfigKey,
    pub key_item_next: ControlsConfigKey,
    pub key_item_prev: ControlsConfigKey,
    pub key_item_slot1: ControlsConfigKey,
    pub key_item_slot2: ControlsConfigKey,
    pub key_item_slot3: ControlsConfigKey,
    pub key_item_slot4: ControlsConfigKey,
    pub key_item_slot5: ControlsConfigKey,
    pub key_item_slot6: ControlsConfigKey,
    pub key_item_slot7: ControlsConfigKey,
    pub key_item_slot8: ControlsConfigKey,
    pub key_item_slot9: ControlsConfigKey,
    pub key_item_slot10: ControlsConfigKey,
    pub key_takescreenshot: ControlsConfigKey,
    pub key_replayedit_open: ControlsConfigKey,
    pub aim_stick: ControlsConfigKey,
    pub key_ui_confirm: ControlsConfigKey,
    pub key_ui_drag: ControlsConfigKey,
    pub key_ui_quick_drag: ControlsConfigKey,
    pub gamepad_analog_sticks_threshold: f32,
    pub gamepad_analog_buttons_threshold: f32,
}
#[repr(C)]
#[derive(Debug)]
pub enum VsyncMode {
    Off,
    On,
    Adaptive,
}

#[repr(C)]
#[derive(Debug)]
pub enum FullscreenMode {
    Windowed,
    Stretched,
    Full,
}

#[derive(Debug)]
#[repr(C)]
pub struct GraphicsSettings {
    pub window_w: usize,
    pub window_h: usize,
    pub fullscreen: FullscreenMode,
    pub caption: StdString,
    pub icon_bmp: StdString,
    pub textures_resize_to_power_of_two: bool,
    pub textures_fix_alpha_channel: bool,
    padding1: [u8; 2],
    pub vsync: VsyncMode,
    pub current_display: usize,
    pub external_graphics_context: *const c_void,
}
